package com.qumap.item.test.iteminfo.item1.filter;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;

/**
 * Created by IntelliJ IDEA.
 * User: Admin
 * Date: 13.06.11
 * Time: 21:18
 * To change this template use File | Settings | File Templates.
 */
public class FilterEditPanel implements  IFilterDisplay {

    interface FilterEditPanelUiBinder extends UiBinder<Widget, FilterEditPanel> {
    }

    private static FilterEditPanelUiBinder ourUiBinder = GWT.create(FilterEditPanelUiBinder.class);

    @UiField
    TextBox down_id;
    @UiField
    TextBox top_id;
    @UiField
    Button filter_button;

    private Widget root;

    public FilterEditPanel() {
        root = ourUiBinder.createAndBindUi(this);

    }

    @Override
    public Integer getUpperID() {
        return Integer.parseInt(top_id.getValue());
    }

    @Override
    public Integer getDownID() {
        return Integer.parseInt(down_id.getValue());
    }

    @Override
    public HasClickHandlers getFilterButton() {
        return filter_button;
    }

    @Override
    public Widget asWidget() {
        return root;
    }

}